<?php
require_once './model/db.php';
require_once './model/articles.php';
if (isset($_GET['page'])){
            $page = $_GET['page'];
}else {
            $page = 1;
        }
$obj = new articles();
$data = $obj->xemar($page);

?>
<div id="content">
    <?php    foreach ($data as $value) {?>
        <div class="post">
            <h1 class="title"><a href="<?php echo "index_1.php?view=".$value["id"] ?>"><?php echo $value["title"]; ?></a></h1>
            <p class="meta"><small><?php echo date('d-m-Y', time()); ?><a href="#">  MinhKhoa</a></small></p>
            <div class="entry">
                <?php
                echo $value["body"];
                ?>
            </div>
        </div>
    <?php }?>
    <?php            require_once './pagination.php';?>
</div>
